/*
* 2号引脚连按键开关，接上拉电阻10k
*/
const int pushButton = 2;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(pushButton, INPUT);
}

void loop() {
  int sensor = digitalRead(pushButton);
  Serial.println(sensor); // 输出开关状态值, 未按下是HIGH，按下是LOW
  delay(1);
}
